package top.yfq.multidatasource.tenant;

/**
 * @author yfq
 * @date 2025/9/26 22:34
 * @description
 */
public class TenantContextHolder {
    private static final ThreadLocal<Long> CURRENT_TENANT = new ThreadLocal<>();

    public static void setTenantId(long tenantId) {
        CURRENT_TENANT.set(tenantId);
    }

    public static Long getTenantId() {
        return CURRENT_TENANT.get();
    }

    public static void clear() {
        CURRENT_TENANT.remove();
    }
}
